import { combineReducers, createStore, applyMiddleware } from 'redux'
import { appReducer } from './app/reducers'
import { authReducer } from './auth/reducers'
import { composeWithDevTools } from 'redux-devtools-extension';
import {createLogger} from 'redux-logger'
import thunk from 'redux-thunk'

const rootReducer = combineReducers({
  app: appReducer,
  auth: authReducer,
})

// 使用日志打印方法， collapsed让action折叠，看着舒服。
const loggerMiddleware = createLogger({collapsed: true});

export default createStore(
  rootReducer,
  composeWithDevTools(
    applyMiddleware(thunk, loggerMiddleware)
  )
)

